package Test_2019_2_26.Test2;

import java.util.List;

/**
 * @author 安天宝
 * JAVA一班
 * 2019-2-26 15:58:06
 */
public class Test {
    public static void main(String[] args) throws Exception {
        JdbcUtil jdbcUtil = new JdbcUtil();
        // 操作之前查询数据
        List<Student> students = jdbcUtil.Select();
        System.out.println("添加前：");
        for (Student student : students) {
            System.out.println(student);
        }
        // 进行添加操作
        Student student = new Student("316202070102","张敏","1998-08-17","好困啊");
        int rlt = jdbcUtil.add(student);
        if(rlt != 0){
            System.out.println("添加后：");
            List<Student> studentAfter = jdbcUtil.Select();
            for (Student stu : studentAfter) {
                System.out.println(stu);
            }
        }else{
            System.out.println("添加失败！");
        }

    }
}
